﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace VisionCloud.Core.Model.Sys
{
    [Table("SysLog")]
    public class SysLog
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required]
        [Column(TypeName = "timestamp(0)")]
        public DateTime CreatedDate { get; set; }

        [Column(TypeName = "varchar(32)")]
        public string Ip { get; set; }

        [Column(TypeName = "varchar(32)")]
        public string CreatedByName { get; set; }

        [Column(TypeName = "varchar(32)")]
        public string SystemModule { get; set; }

        public enum EmLogType
        {
            登录 = 0,
            访问 = 1,
            操作 = 2,
            异常 = 3
        }

        [Column(TypeName = "int4")]
        public EmLogType LogType { get; set; }

        public enum EmExecResult
        {
            Success = 0,
            Error = 1
        }

        [Column(TypeName = "int4")]
        public EmExecResult ExecResult { get; set; }

        [Column(TypeName = "text")]
        public string Description { get; set; }
    }
}